package com.dlz.systemshop.service.impl;

import com.dlz.systemshop.mapper.UserMapper;
import com.dlz.systemshop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 你的姓名
 * @date 2025/1/4 02:49
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public Boolean saveVatar(String username, String vatar) {
        if (userMapper.findUserByUsername(username)==null){
            return userMapper.saveVatar(vatar,username);
        }
        System.out.println(vatar);
        return userMapper.updateUserAvatar(vatar,username);
    }

    @Override
    public String getAvatarURL(String userName) {
        return userMapper.getAvatarURL(userName);
    }
}
